<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>合约交友 - 高级筛选</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        :root {
            --primary: #4f46e5;
            --primary-light: #f0f9ff;
            --secondary: #64748b;
            --light: #f8fafc;
            --dark: #1e293b;
            --success: #10b981;
            --danger: #ef4444;
            --warning: #f59e0b;
            --border: #e2e8f0;
            --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
            --shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.1);
        }
        
        body {
            font-family: 'Inter', system-ui, sans-serif;
            background-color: #f8fafc;
            color: var(--dark);
            line-height: 1.6;
        }
        
        .navbar {
            box-shadow: var(--shadow);
            background-color: white;
        }
        
        .container {
            padding: 2rem 0;
        }
        
        .section-title {
            font-size: 1.8rem;
            font-weight: 700;
            margin-bottom: 1.5rem;
            padding-bottom: 0.75rem;
            border-bottom: 2px solid var(--primary);
            display: inline-block;
        }
        
        /* 筛选区域样式 */
        .filter-section {
            background-color: white;
            border-radius: 0.75rem;
            padding: 1.5rem;
            margin-bottom: 2rem;
            box-shadow: var(--shadow);
        }
        
        .filter-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
        }
        
        .filter-title {
            font-weight: 600;
            font-size: 1.2rem;
            color: var(--dark);
        }
        
        .filter-toggle {
            color: var(--primary);
            background: none;
            border: none;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            cursor: pointer;
            font-size: 0.9rem;
        }
        
        .filter-groups {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
            gap: 1.5rem;
            margin-bottom: 1.5rem;
        }
        
        .filter-group {
            margin-bottom: 0;
        }
        
        .filter-label {
            display: block;
            margin-bottom: 0.75rem;
            font-weight: 500;
            color: var(--dark);
        }
        
        .filter-options {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin-bottom: 0.5rem;
        }
        
        .filter-chip {
            background-color: var(--light);
            border: 1px solid var(--border);
            border-radius: 999px;
            padding: 0.375rem 0.75rem;
            font-size: 0.875rem;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .filter-chip:hover {
            background-color: var(--primary-light);
            border-color: var(--primary);
        }
        
        .filter-chip.active {
            background-color: var(--primary);
            color: white;
            border-color: var(--primary);
        }
        
        .range-slider {
            width: 100%;
            margin: 1rem 0;
        }
        
        .range-values {
            display: flex;
            justify-content: space-between;
            font-size: 0.875rem;
            color: var(--secondary);
        }
        
        .filter-actions {
            display: flex;
            justify-content: flex-end;
            gap: 1rem;
            padding-top: 1rem;
            border-top: 1px solid var(--border);
        }
        
        /* 快捷筛选标签 */
        .quick-filters {
            display: flex;
            flex-wrap: wrap;
            gap: 0.75rem;
            margin-bottom: 1.5rem;
        }
        
        .quick-filter {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            background-color: white;
            border: 1px solid var(--border);
            border-radius: 999px;
            padding: 0.5rem 1rem;
            font-size: 0.9rem;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .quick-filter:hover {
            border-color: var(--primary);
            color: var(--primary);
        }
        
        .quick-filter.active {
            background-color: var(--primary);
            color: white;
            border-color: var(--primary);
        }
        
        /* 结果统计 */
        .results-stats {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
            font-size: 0.9rem;
            color: var(--secondary);
        }
        
        /* 列表样式 */
        .contract-list {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 1.5rem;
        }
        
        .card {
            border: none;
            border-radius: 0.75rem;
            overflow: hidden;
            box-shadow: var(--shadow);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }
        
        .card:hover {
            transform: translateY(-5px);
            box-shadow: var(--shadow-hover);
        }
        
        .card-header {
            background-color: var(--primary-light);
            padding: 1rem 1.25rem;
            border-bottom: 1px solid var(--border);
        }
        
        .card-title {
            font-weight: 600;
            margin-bottom: 0;
        }
        
        .card-body {
            padding: 1.25rem;
        }
        
        .contract-meta {
            display: flex;
            justify-content: space-between;
            margin-bottom: 1rem;
            font-size: 0.9rem;
            color: var(--secondary);
        }
        
        .author-info {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        
        .author-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            object-fit: cover;
        }
        
        .stats {
            display: flex;
            gap: 1rem;
        }
        
        .stat-item {
            display: flex;
            align-items: center;
            gap: 0.25rem;
        }
        
        .contract-content {
            margin-bottom: 1rem;
        }
        
        .contract-text {
            margin-bottom: 1rem;
            line-height: 1.7;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        
        .image-container {
            border-radius: 0.5rem;
            overflow: hidden;
            margin-bottom: 1rem;
            height: 180px;
        }
        
        .contract-image {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .no-image {
            background-color: #e2e8f0;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--secondary);
        }
        
        .card-footer {
            background-color: white;
            padding: 1rem 1.25rem;
            border-top: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
        }
        
        .action-buttons {
            display: flex;
            gap: 1rem;
        }
        
        .action-btn {
            display: flex;
            align-items: center;
            gap: 0.25rem;
            color: var(--secondary);
            background: none;
            border: none;
            padding: 0.25rem 0.75rem;
            border-radius: 0.25rem;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .action-btn:hover {
            background-color: var(--primary-light);
            color: var(--primary);
        }
        
        /* 响应式设计 */
        @media (max-width: 768px) {
            .filter-groups {
                grid-template-columns: 1fr;
            }
            
            .filter-actions {
                flex-direction: column;
            }
            
            .filter-actions button {
                width: 100%;
            }
            
            .results-stats {
                flex-direction: column;
                align-items: flex-start;
                gap: 0.5rem;
            }
        }
    </style>
</head>
<body>
    <!-- 导航栏 -->
    <nav class="navbar navbar-expand-lg navbar-light">
        <div class="container">
            <a class="navbar-brand" href="#">
                <i class="fas fa-handshake text-primary me-2"></i>合约社交
            </a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav me-auto">
                    <li class="nav-item">
                        <a class="nav-link" href="#">首页</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link active" href="#">合约交友</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#">安全中心</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#">帮助指南</a>
                    </li>
                </ul>
                <div class="d-flex align-items-center gap-3">
                    <button class="btn btn-outline-primary">登录</button>
                    <button class="btn btn-primary">注册</button>
                </div>
            </div>
        </div>
    </nav>
    
    <!-- 主要内容区 -->
    <div class="container">
        <h2 class="section-title">合约交友列表</h2>
        
        <!-- 搜索框 -->
        <div class="input-group mb-4">
            <input type="text" class="form-control" placeholder="搜索合约标题、内容或作者...">
            <button class="btn btn-primary">
                <i class="fas fa-search me-1"></i> 搜索
            </button>
        </div>
        
        <!-- 快捷筛选标签 -->
        <div class="quick-filters">
            <div class="quick-filter active">
                <i class="fas fa-th"></i> 全部
            </div>
            <div class="quick-filter">
                <i class="fas fa-clock"></i> 最新发布
            </div>
            <div class="quick-filter">
                <i class="fas fa-fire"></i> 热门推荐
            </div>
            <div class="quick-filter">
                <i class="fas fa-map-marker-alt"></i> 同城
            </div>
            <div class="quick-filter">
                <i class="fas fa-star"></i> 已认证
            </div>
        </div>
        
        <!-- 高级筛选区域 -->
        <div class="filter-section">
            <div class="filter-header">
                <div class="filter-title">高级筛选</div>
                <button class="filter-toggle" id="toggleFilter">
                    <i class="fas fa-chevron-up"></i>
                    <span>收起筛选</span>
                </button>
            </div>
            
            <div class="filter-content" id="filterContent">
                <div class="filter-groups">
                    <!-- 合约类型筛选 -->
                    <div class="filter-group">
                        <label class="filter-label">合约类型</label>
                        <div class="filter-options">
                            <div class="filter-chip active">全部</div>
                            <div class="filter-chip">兴趣伙伴</div>
                            <div class="filter-chip">学习互助</div>
                            <div class="filter-chip">活动同行</div>
                            <div class="filter-chip">项目合作</div>
                            <div class="filter-chip">生活陪伴</div>
                        </div>
                    </div>
                    
                    <!-- 地区筛选 -->
                    <div class="filter-group">
                        <label class="filter-label">地区</label>
                        <div class="filter-options">
                            <div class="filter-chip active">全部</div>
                            <div class="filter-chip">北京</div>
                            <div class="filter-chip">上海</div>
                            <div class="filter-chip">广州</div>
                            <div class="filter-chip">深圳</div>
                            <div class="filter-chip">杭州</div>
                            <div class="filter-chip">其他</div>
                        </div>
                    </div>
                    
                    <!-- 性别筛选 -->
                    <div class="filter-group">
                        <label class="filter-label">对方性别</label>
                        <div class="filter-options">
                            <div class="filter-chip active">不限</div>
                            <div class="filter-chip">男</div>
                            <div class="filter-chip">女</div>
                        </div>
                    </div>
                    
                    <!-- 年龄范围筛选 -->
                    <div class="filter-group">
                        <label class="filter-label">年龄范围</label>
                        <input type="range" min="18" max="60" value="30" class="range-slider" id="ageRange">
                        <div class="range-values">
                            <span>18岁</span>
                            <span id="ageDisplay">18-30岁</span>
                            <span>60岁</span>
                        </div>
                    </div>
                    
                    <!-- 活动频率筛选 -->
                    <div class="filter-group">
                        <label class="filter-label">活动频率</label>
                        <div class="filter-options">
                            <div class="filter-chip active">不限</div>
                            <div class="filter-chip">每天</div>
                            <div class="filter-chip">每周</div>
                            <div class="filter-chip">每月</div>
                            <div class="filter-chip">不定期</div>
                        </div>
                    </div>
                    
                    <!-- 活动方式筛选 -->
                    <div class="filter-group">
                        <label class="filter-label">活动方式</label>
                        <div class="filter-options">
                            <div class="filter-chip active">不限</div>
                            <div class="filter-chip">线上</div>
                            <div class="filter-chip">线下</div>
                            <div class="filter-chip">线上+线下</div>
                        </div>
                    </div>
                </div>
                
                <!-- 更多筛选条件 -->
                <div class="filter-groups">
                    <!-- 兴趣标签筛选 -->
                    <div class="filter-group">
                        <label class="filter-label">兴趣标签</label>
                        <div class="filter-options">
                            <div class="filter-chip">阅读</div>
                            <div class="filter-chip">运动</div>
                            <div class="filter-chip">电影</div>
                            <div class="filter-chip">音乐</div>
                            <div class="filter-chip">旅行</div>
                            <div class="filter-chip">美食</div>
                            <div class="filter-chip">摄影</div>
                            <div class="filter-chip">编程</div>
                            <div class="filter-chip">
                                <i class="fas fa-plus"></i> 更多
                            </div>
                        </div>
                    </div>
                    
                    <!-- 语言能力筛选 -->
                    <div class="filter-group">
                        <label class="filter-label">语言能力</label>
                        <select class="form-select">
                            <option value="">不限</option>
                            <option value="chinese">中文</option>
                            <option value="english">英语</option>
                            <option value="japanese">日语</option>
                            <option value="korean">韩语</option>
                            <option value="french">法语</option>
                            <option value="german">德语</option>
                        </select>
                    </div>
                    
                    <!-- 价格范围筛选 -->
                    <div class="filter-group">
                        <label class="filter-label">预算范围</label>
                        <select class="form-select">
                            <option value="">不限</option>
                            <option value="free">免费</option>
                            <option value="low">50元以下</option>
                            <option value="medium">50-200元</option>
                            <option value="high">200-500元</option>
                            <option value="vhigh">500元以上</option>
                        </select>
                    </div>
                    
                    <!-- 发布时间筛选 -->
                    <div class="filter-group">
                        <label class="filter-label">发布时间</label>
                        <select class="form-select">
                            <option value="">不限</option>
                            <option value="today">今天</option>
                            <option value="week">本周</option>
                            <option value="month">本月</option>
                            <option value="3month">近3个月</option>
                        </select>
                    </div>
                </div>
                
                <!-- 筛选操作按钮 -->
                <div class="filter-actions">
                    <button class="btn btn-outline-secondary">
                        <i class="fas fa-sync-alt me-1"></i> 重置筛选
                    </button>
                    <button class="btn btn-primary">
                        <i class="fas fa-filter me-1"></i> 应用筛选
                    </button>
                </div>
            </div>
        </div>
        
        <!-- 结果统计和排序 -->
        <div class="results-stats">
            <div>找到 <strong>246</strong> 个符合条件的合约</div>
            <div class="d-flex align-items-center gap-2">
                <span>排序方式:</span>
                <select class="form-select form-select-sm" style="width: auto;">
                    <option>推荐优先</option>
                    <option>最新发布</option>
                    <option>最多浏览</option>
                    <option>最多互动</option>
                </select>
            </div>
        </div>
        
        <!-- 合约列表 -->
        <div class="contract-list">
            <!-- 合约1 -->
            <div class="card">
                <div class="card-header">
                    <h5 class="card-title">寻找摄影伙伴 - 周末户外采风</h5>
                </div>
                <div class="card-body">
                    <div class="contract-meta">
                        <div class="author-info">
                            <img src="https://picsum.photos/100/100?random=1" alt="李明的头像" class="author-avatar">
                            <span>李明, 28岁</span>
                        </div>
                        <div class="stats">
                            <div class="stat-item">
                                <i class="fas fa-eye"></i> 328
                            </div>
                            <div class="stat-item">
                                <i class="fas fa-comment"></i> 42
                            </div>
                        </div>
                    </div>
                    
                    <div class="contract-content">
                        <p class="contract-text">寻找摄影爱好者一起周末外出采风，主要拍摄自然风光和城市建筑。希望对方有一定摄影基础，有自己的设备，能互相交流学习。</p>
                        
                        <div class="image-container">
                            <img src="https://picsum.photos/600/400?random=10" alt="摄影作品示例" class="contract-image">
                        </div>
                        
                        <div class="filter-tags d-flex flex-wrap gap-1 mb-2">
                            <span class="badge bg-primary-light text-primary fs-6">摄影</span>
                            <span class="badge bg-primary-light text-primary fs-6">户外活动</span>
                            <span class="badge bg-primary-light text-primary fs-6">周末</span>
                            <span class="badge bg-primary-light text-primary fs-6">北京</span>
                        </div>
                    </div>
                </div>
                <div class="card-footer">
                    <div class="action-buttons">
                        <button class="action-btn">
                            <i class="fas fa-heart"></i> 86
                        </button>
                        <button class="action-btn">
                            <i class="fas fa-bookmark"></i> 52
                        </button>
                    </div>
                    <button class="btn btn-primary btn-sm">
                        联系TA
                    </button>
                </div>
            </div>
            
            <!-- 合约2 -->
            <div class="card">
                <div class="card-header">
                    <h5 class="card-title">寻找英语学习伙伴 - 每周线上交流</h5>
                </div>
                <div class="card-body">
                    <div class="contract-meta">
                        <div class="author-info">
                            <img src="https://picsum.photos/100/100?random=2" alt="张雪的头像" class="author-avatar">
                            <span>张雪, 25岁</span>
                        </div>
                        <div class="stats">
                            <div class="stat-item">
                                <i class="fas fa-eye"></i> 512
                            </div>
                            <div class="stat-item">
                                <i class="fas fa-comment"></i> 78
                            </div>
                        </div>
                    </div>
                    
                    <div class="contract-content">
                        <p class="contract-text">本人英语水平雅思6.5，希望找一位水平相当的伙伴一起练习口语和写作。计划每周线上交流2-3次，每次1小时左右。</p>
                        
                        <div class="image-container">
                            <img src="https://picsum.photos/600/400?random=20" alt="英语学习资料" class="contract-image">
                        </div>
                        
                        <div class="filter-tags d-flex flex-wrap gap-1 mb-2">
                            <span class="badge bg-primary-light text-primary fs-6">英语</span>
                            <span class="badge bg-primary-light text-primary fs-6">学习</span>
                            <span class="badge bg-primary-light text-primary fs-6">线上</span>
                            <span class="badge bg-primary-light text-primary fs-6">上海</span>
                        </div>
                    </div>
                </div>
                <div class="card-footer">
                    <div class="action-buttons">
                        <button class="action-btn">
                            <i class="fas fa-heart"></i> 124
                        </button>
                        <button class="action-btn">
                            <i class="fas fa-bookmark"></i> 93
                        </button>
                    </div>
                    <button class="btn btn-primary btn-sm">
                        联系TA
                    </button>
                </div>
            </div>
            
            <!-- 合约3 -->
            <div class="card">
                <div class="card-header">
                    <h5 class="card-title">寻找健身伙伴 - 每天早晨跑步</h5>
                </div>
                <div class="card-body">
                    <div class="contract-meta">
                        <div class="author-info">
                            <img src="https://picsum.photos/100/100?random=3" alt="王强的头像" class="author-avatar">
                            <span>王强, 30岁</span>
                        </div>
                        <div class="stats">
                            <div class="stat-item">
                                <i class="fas fa-eye"></i> 276
                            </div>
                            <div class="stat-item">
                                <i class="fas fa-comment"></i> 35
                            </div>
                        </div>
                    </div>
                    
                    <div class="contract-content">
                        <p class="contract-text">本人住在朝阳区，每天早晨6点半在奥林匹克森林公园跑步，寻找一位能长期坚持的伙伴一起锻炼。要求：有基础，能跑5公里以上。</p>
                        
                        <div class="image-container no-image">
                            <i class="fas fa-running fa-3x"></i>
                        </div>
                        
                        <div class="filter-tags d-flex flex-wrap gap-1 mb-2">
                            <span class="badge bg-primary-light text-primary fs-6">健身</span>
                            <span class="badge bg-primary-light text-primary fs-6">跑步</span>
                            <span class="badge bg-primary-light text-primary fs-6">每天</span>
                            <span class="badge bg-primary-light text-primary fs-6">北京</span>
                        </div>
                    </div>
                </div>
                <div class="card-footer">
                    <div class="action-buttons">
                        <button class="action-btn">
                            <i class="fas fa-heart"></i> 76
                        </button>
                        <button class="action-btn">
                            <i class="fas fa-bookmark"></i> 42
                        </button>
                    </div>
                    <button class="btn btn-primary btn-sm">
                        联系TA
                    </button>
                </div>
            </div>
        </div>
        
        <!-- 分页 -->
        <nav class="mt-5">
            <ul class="pagination justify-content-center">
                <li class="page-item disabled">
                    <a class="page-link" href="#" tabindex="-1">上一页</a>
                </li>
                <li class="page-item active"><a class="page-link" href="#">1</a></li>
                <li class="page-item"><a class="page-link" href="#">2</a></li>
                <li class="page-item"><a class="page-link" href="#">3</a></li>
                <li class="page-item">
                    <a class="page-link" href="#">...</a>
                </li>
                <li class="page-item"><a class="page-link" href="#">12</a></li>
                <li class="page-item">
                    <a class="page-link" href="#">下一页</a>
                </li>
            </ul>
        </nav>
    </div>
    
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // 筛选区域折叠/展开功能
            const toggleFilter = document.getElementById('toggleFilter');
            const filterContent = document.getElementById('filterContent');
            let filterExpanded = true;
            
            toggleFilter.addEventListener('click', function() {
                filterExpanded = !filterExpanded;
                
                if (filterExpanded) {
                    filterContent.style.display = 'block';
                    toggleFilter.innerHTML = '<i class="fas fa-chevron-up"></i><span>收起筛选</span>';
                } else {
                    filterContent.style.display = 'none';
                    toggleFilter.innerHTML = '<i class="fas fa-chevron-down"></i><span>展开筛选</span>';
                }
            });
            
            // 年龄范围滑块
            const ageRange = document.getElementById('ageRange');
            const ageDisplay = document.getElementById('ageDisplay');
            
            ageRange.addEventListener('input', function() {
                ageDisplay.textContent = `18-${this.value}岁`;
            });
            
            // 筛选芯片选择功能
            const filterChips = document.querySelectorAll('.filter-chip');
            
            filterChips.forEach(chip => {
                chip.addEventListener('click', function() {
                    // 如果点击的是"全部"或"不限"，取消同组其他选中状态
                    if (this.textContent === '全部' || this.textContent === '不限') {
                        const parentGroup = this.closest('.filter-options');
                        parentGroup.querySelectorAll('.filter-chip').forEach(c => {
                            c.classList.remove('active');
                        });
                        this.classList.add('active');
                    } else {
                        // 取消同组中"全部"或"不限"的选中状态
                        const parentGroup = this.closest('.filter-options');
                        parentGroup.querySelectorAll('.filter-chip').forEach(c => {
                            if (c.textContent === '全部' || c.textContent === '不限') {
                                c.classList.remove('active');
                            }
                        });
                        
                        // 切换当前芯片状态
                        this.classList.toggle('active');
                    }
                });
            });
            
            // 快捷筛选标签选择
            const quickFilters = document.querySelectorAll('.quick-filter');
            
            quickFilters.forEach(filter => {
                filter.addEventListener('click', function() {
                    quickFilters.forEach(f => f.classList.remove('active'));
                    this.classList.add('active');
                });
            });
            
            // 应用筛选按钮
            const applyFilterBtn = document.querySelector('.filter-actions .btn-primary');
            applyFilterBtn.addEventListener('click', function() {
                // 这里可以添加筛选逻辑
                alert('筛选已应用，正在加载符合条件的合约...');
            });
            
            // 重置筛选按钮
            const resetFilterBtn = document.querySelector('.filter-actions .btn-outline-secondary');
            resetFilterBtn.addEventListener('click', function() {
                // 重置所有筛选条件
                document.querySelectorAll('.filter-chip').forEach(chip => {
                    chip.classList.remove('active');
                    if (chip.textContent === '全部' || chip.textContent === '不限') {
                        chip.classList.add('active');
                    }
                });
                
                document.querySelectorAll('select.form-select').forEach(select => {
                    select.selectedIndex = 0;
                });
                
                ageRange.value = 30;
                ageDisplay.textContent = '18-30岁';
                
                quickFilters.forEach(f => f.classList.remove('active'));
                quickFilters[0].classList.add('active');
            });
        });
    </script>
</body>
</html>
    
